<link rel="stylesheet" href="../css/adminpending.css">
<% Date.prototype.Format = function (fmt) { //author: meizz
    var o = {
        "M+": this.getMonth() + 1,                 //月份
        "d+": this.getDate(),                    //日
        "h+": this.getHours(),                   //小时
        "m+": this.getMinutes(),                 //分
        "s+": this.getSeconds(),                 //秒
        "q+": Math.floor((this.getMonth() + 3) / 3), //季度
        "S": this.getMilliseconds()             //毫秒
    };
    if (/(y+)/.test(fmt))
        fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o)
        if (new RegExp("(" + k + ")").test(fmt))
            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    return fmt;
}
%>

<div class="body">
    <%for(var i=0;i<data.length;i++){%>
    <ul id="<%=data[i].id%>">
        <p style="padding-left: 3%;padding-top:5px;font-size: 1.5rem;background: #f8f8f8;">来自<span style="color:#ff3333"><%=data[i].userid%></span>用户的订单</p>
        <% var amounts=0,num=0;for(var j=0;j<data2.length;j++){if(data[i].id == data2[j].payid){%>
        <li>
            <div class="goods-img">
                <img src="<%=data2[j].goodimg%>" width="100%">
            </div>
            <div class="goods-desc">
                <p class="desc-name"><%=data2[j].name%></p>
                <p class="desc-type"><span><%=new Date(data2[j].starttime).Format('MM.dd')%>-<%=new Date(data2[j].endtime).Format('MM.dd')%></span></p>
            </div>
            <div class="goods-price">
                <p class="price">￥<%=data2[j].price%></p>
                <p class="num"><span>x<%=data2[j].count%></span></p>
            </div>
            <span style="display: none"><%= amounts+=parseFloat(data2[j].price).toFixed(2)*parseInt(data2[j].count)%></span>
            <span style="display: none"><%=num+=data2[j].count%></span>
        </li>
        <%}%>
        <%}%>
        <div class="statistics">
            <p>共<span class="nums"><%=num%></span>个商品 合计：<span>￥</span><span class="total"><%=amounts%></span></p>
        </div>
        <div class="deal-order">
            <%if(data[i].isdeposit==1&&data[i].ispayment!=1){%>
            <div class="deal-button" onclick="MAIN.pendingOrder('<%=data[i].userid%>','<%=data[i].id%>')">待处理</div>
            <%}else if(data[i].isdeposit==1&&data[i].ispayment==1){%>
            <div class="dealed-button">已处理</div>
            <%}%>
        </div>
    </ul>
    <%}%>
    <div class="bottom" style="width: 100%;height: 70px;"></div>
</div>
